﻿#include "OperGlobalFrequencyDomain.h"
#include "GUIFrame/MainWindow.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsPhysics.h"
#include "GUIDialog/GUIPostDialog/GUIGlobalFrequencyDomainDialog.h"
#include <QMessageBox>

namespace ModelOper
{
    bool OperGlobalFrequencyDomain::execGUI()
    {
        //获取主窗口和动作对象
        GUI::MainWindow * mainWindow = dynamic_cast<GUI::MainWindow *>(FITKAPP->getGlobalData()->getMainWindow());
        if (!mainWindow) return false;
        //获取物理数据
        Acoustics::FITKAcousticsPhysics* phyMgr = FITKAPP->getGlobalData()->getPhysicsData<Acoustics::FITKAcousticsPhysics>();
        if (!phyMgr) return false;
        //获取全局频谱范围
        Acoustics::FITKGlobalFrequencyDomain* freqDomain = phyMgr->getFrequencyDomain();
        if (!freqDomain) return false;
        GUI::GUIGlobalFrequencyDomainDialog* dialog = new GUI::GUIGlobalFrequencyDomainDialog(freqDomain, this, mainWindow);
        dialog->show();
        return true;
    }
    bool OperGlobalFrequencyDomain::execProfession()
    {
        
        return true;
    }
}

